<!doctype html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<title>天天生鲜-后台登陆</title>
<link rel="stylesheet" href="css/login.css">
<link rel="short icon" href="images/logo.png" type="image/x-icon">
<script type="text/javascript" src="js/jquery.min.js"></script>
<script src="../layer/layer.js"></script>
</head>
<body>
	<div id="login_top">
		<div id="welcome">
			欢迎使用天天生鲜后台管理系统
		</div>
		<div id="back">
			<a href="../index.html">返回首页</a>&nbsp;&nbsp; | &nbsp;&nbsp;
			<a href="#">帮助</a>
		</div>
	</div>
	<div id="login_center">
		<div id="login_area">
			<div id="login_form">
				<form action="" method="post" id="myform">
					<div id="login_tip">
						用户登录&nbsp;&nbsp;UserLogin
					</div>
					<div><input type="text" class="username" id="account" placeholder="请输入账号..."></div>
					<div><input type="password" class="pwd" id="pwd" placeholder="请输入密码..."></div>
					<div id="btn_area">
						<input type="button" id="sub_btn" value="登&nbsp;&nbsp;录">&nbsp;&nbsp;
					</div>
				</form>
			</div>
		</div>
	</div>
	<div id="login_bottom">
		<label style="color:#FFF"><a class="copy" href="http://www.hyycinfo.com">衡阳市源辰信息科技有限公司 </a>&copy; 版权所有</label>
	</div>
</body>
<script type="text/javascript">
$("#sub_btn").click(function(){
	var account = $("#account").val();
	var pwd = $("#pwd").val();
	if( account==null || account=='' || pwd==null || pwd=='' ){
		layer.msg('<h2>账号密码不可为空！</h2>');
		return ;
	}
	$.post("../admin/login",{aname:account,pwd:pwd},function(data){
		data = parseInt($.trim(data));
		if(data == -2){
			layer.msg('<h2>账号或密码错误...</h2>');
		}else if( data == 1 ){
			layer.msg('<h2>登录成功！</h2>');
			setInterval(function(){
				location.href="manager/index.html";
			},1500);
		}else{
			layer.msg('<h2>登录失败！</h2>');
		}
	});
});
</script>
</html>